project(
	'screenshot',
	'c',
	'cpp',
	version: '0.2.0',
	license: 'MIT',
	meson_version: '>=0.59.0',
	default_options: [
		'cpp_std=c++17',
		'c_std=c11',
		'warning_level=2',
		'werror=false',
	],
)

add_project_arguments( '-fPIC', language: ['cpp', 'c'])

dependency( 'pkg-config', required : true )
QtDeps = dependency( 'qt6', modules: [ 'Core', 'Gui', 'Widgets', 'MultimediaWidgets' ], required : false )

if QtDeps.found()
	wayqt  = dependency( 'wayqt-qt6', required : true )
else
	QtDeps = dependency( 'qt5', modules: [ 'Core', 'Gui', 'Widgets', 'MultimediaWidgets' ], required : true )
	wayqt  = dependency( 'wayqt', required : true )
endif

wayland_client = dependency( 'wayland-client' )
rt = meson.get_compiler( 'cpp' ).find_library( 'rt' )

executable(
	'screenshot', [ 'Screenshot.cpp' ],
	install : false,
	dependencies : [QtDeps, wayqt]
)

subdir( 'protos' )

executable(
	'screencast', [ 'Screencast.cpp' ],
	install : false,
	dependencies : [QtDeps, wayqt, wayland_client, rt, protos]
)
